from pydantic import BaseModel
from typing import Optional
from typing import Union


class UnifyResponse(BaseModel):
    status: int = 0
    result: int = 0
    data: Union[dict, str, list, None] = None
    extra_info: Union[dict, str, list, None] = None
    message: str = ''
    return_code: int = 0


default_return_value = {
    'message': "",
    'status': 0,  # 0: 请求成功,1:请求失败
    'result': 1,
    'return_code': 0,  # 0成功
    'error_code': 0  # 0成功,1.warning , 2 error
}

update_to_much_rows_err_message_reg = r"Update\(([0-9]*) rows\) more than ([0-9]*) rows."
